package com.kgc.crowd.distributioncrowdcommon.api;

import com.kgc.crowd.distributioncrowdcommon.pojo.*;
import com.kgc.crowd.distributioncrowdcommon.util.CrowdConstant;
import com.kgc.crowd.distributioncrowdcommon.util.CrowdUtils;
import com.kgc.crowd.distributioncrowdcommon.vo.MemberConfirmInfoVO;
import com.kgc.crowd.distributioncrowdcommon.vo.ProjectVO;
import com.kgc.crowd.distributioncrowdcommon.vo.ReturnVO;
import com.kgc.crowd.distributioncrowdcommon.vo.TagVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.List;
@FeignClient("DISTRIBUTION-CROWD-PROJECT-MANAGER")
public interface ProjectManagerRemoteService {
    @RequestMapping("/project/manager/initCreation")
    public ResultEntity<ProjectVO> initCreation(
            @RequestParam("memberSignToken") String memberSignToken);
    /**
     * 点击上传项目头图时调用
     * @param memberSignToken 登录成功时，生成的token
     * @param projectTempToken  项目初始化时，生成的token
     * @param headerPicturePath 图片上传成功后OSS上的图片路径
     * @return
     */
    @RequestMapping("/project/manager/save/head/picture/path")
    public ResultEntity<String> saveHeadPicturePath(
            @RequestParam("memberSignToken") String memberSignToken,
            @RequestParam("projectTempToken") String projectTempToken,
            @RequestParam("headerPicturePath") String headerPicturePath
    );
    /**
     * 点击项目详情图片上传时调用
     * @param memberSignToken
     * @param projectTempToken
     * @param detailPicturePathList
     * @return
     */
    @RequestMapping("/project/manager/save/detail/picture/path/list")
    public ResultEntity<String> saveDetailPicturePathList(
            @RequestParam("memberSignToken") String memberSignToken,
            @RequestParam("projectTempToken") String projectTempToken,
            @RequestParam("detailPicturePathList") List<String> detailPicturePathList
    );


    /**
     * 添加项目时点击下一步时，调用
     * @param projectVOFront
     * @return
     */
    @RequestMapping("/project/manager/save/project/information")
    public ResultEntity<String> saveProjectInformation(@RequestBody ProjectVO projectVOFront);

    /**
     * 当在回报设置点击下一步调用
     * @param returnVO
     * @return
     */
    @RequestMapping("/project/manager/save/return/vo")
    public ResultEntity<String> saveReturnVO(@RequestBody ReturnVO returnVO);

    /**
     * 在确认信息时点击下一步
     * @param memberConfirmInfoVO
     * @return
     */
    @RequestMapping("/project/manager/save/member/confirm/info/vo")
    public ResultEntity<String> saveMemberConfirmInfoVO(@RequestBody MemberConfirmInfoVO memberConfirmInfoVO);
    /**
     * 把数据保存到数据库
     * @param memberSignToken 登录成功后的token
     * @param projectTempToken redis中临时保存ProjectVO的键
     * @return
     */
    @RequestMapping("/project/manager/save/whole/project")
    public ResultEntity<String> saveWholeProject(
            @RequestParam("memberSignToken") String memberSignToken,
            @RequestParam("projectTempToken") String projectTempToken);

    @RequestMapping("/project/manager/select/all/type")
    public ResultEntity<List<TypePO>> selectAllType();

    @RequestMapping("/project/manager/select/all/tag")
    public ResultEntity<List<TagVO>> selectAllTag();
    @RequestMapping("/project/manager/selectType")
    public ResultEntity<List<TypePO>>  selectType();

    @RequestMapping("/project/manager/select/project/itempic")
    public ResultEntity<ProjectPO> selectPorjectItemPid(@RequestParam(value="id", defaultValue="0",required = false) Integer id);

    @RequestMapping("/project/manager/select/project/member")
    public ResultEntity< List<ProjectPO>> selectProjectByMemberId(@RequestParam(value="id", defaultValue="0",required = false) Integer id);

    @RequestMapping("/project/manager/select/project/advertisement")
    public ResultEntity<List<ProjectPO>> selectProjectAndAdvertisement(@RequestParam(value="id", defaultValue="0",required = false) Integer id);
    @RequestMapping("/project/manager/select/project/order")
    public ResultEntity<List<Order>> selectOrderAndProject(@RequestParam(value="id", defaultValue="0",required = false) Integer id);

    @RequestMapping("/project/manager/select/project/return")
    public ResultEntity<ProjectPO> selectProjectAndReturn(@RequestParam(value="id", defaultValue="0",required = false) Integer id);
}
